export const orderStore={
  state:{
    orderList:{},
    myAddress:{},
    servings:'',
    note:''
  },
  getters:{
    orderList:state => state.orderList,
    myAddress:state => state.myAddress,
    servings:state => state.servings,
    note:state => state.note,
  },
  mutations: {
    setOrderInfo(state,location){
      if(location){
        state.orderList=location
      }else{
        state.orderList={}
      }
    },
    setMyAddress(state,location){
      if(location){
        state.myAddress=location
      }else{
        state.myAddress={}
      }
    },
    setAddServings(state,location){
      if(location){
        state.servings=location
      }else{
        state.servings=''
      }
    },
    setNote(state,location){
      if(location){
        state.note=location
      }else{
        state.note=''
      }
    }
  },
  actions:{
    setOrderInfo({commit},location){
      commit('setOrderInfo',location)
    },
    setMyAddress({commit},location){
      commit('setMyAddress',location)
    },
    setAddServings({commit},location){
      commit('setAddServings',location)
    },
    setNote({commit},location){
      commit('setNote',location)
    }
  }
}